From: Michael Catanzaro Date: Tue, 23 Feb 2016 02:46:00 +0000 (-0600) Subject: st-entry: Disable middle-click-paste when entry is not editable X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~1013^2^2~968 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=508668107bf4bba46ac73419c5829c53008d47f6;p=gnome-shell.git st-entry: Disable middle-click-paste when entry is not editable Should only allow pasting the primary selection when the entry is editable. https://bugzilla.gnome.org/show_bug.cgi?id=762507 --- diff --git a/src/st/st-entry.c b/src/st/st-entry.c index c1a648d35..77fabc812 100644 --- a/src/st/st-entry.c +++ b/src/st/st-entry.c @@ -566,6 +566,7 @@ clutter_text_button_press_event (ClutterActor *actor, ClutterButtonEvent *event, gpointer user_data) { + StEntryPrivate *priv = ST_ENTRY_PRIV (user_data); GtkSettings *settings = gtk_settings_get_default (); gboolean primary_paste_enabled; @@ -573,7 +574,8 @@ clutter_text_button_press_event (ClutterActor *actor, "gtk-enable-primary-paste", &primary_paste_enabled, NULL); - if (primary_paste_enabled && event->button == 2) + if (primary_paste_enabled && event->button == 2 + && clutter_text_get_editable (CLUTTER_TEXT (priv->entry))) { StClipboard *clipboard;